<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>数点</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/layui.css"  media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/toastr.min.css"  media="all">
	<style type="text/css">
		/* .layui-table-cell {
			overflow:visible;
		} */
	</style>
</head>
<body>
<div style="background-color: #0997F7">
	<h2 style="color:#FFF">工位：检漏工位</h2>
</div>
<div class="" style="margin:10px 0 0 15px;width: 98%">
    <div class="layui-inline">
        <input class="layui-input" style="font-size: 18px;width: 350px" name="keyword" id="keyword"  placeholder="点击查看产品待检列表" autocomplete="off">
    </div>
    <button class="layui-btn layui-btn-blue" onclick="search()" style="margin: 0 0 0 10px;" data-type="reload"><i class="layui-icon layui-icon-search">  搜索</i></button>
    <input class="layui-btn layui-btn-blue" type="button" style="padding: 0 30px;float:right" onclick = "goLeakHunting()" value="检漏">
</div>
<!-- 疑似不良品信息 及操作 -->
<div id="details" style="margin:10px 0 0 15px;display:none;background-color:rgb(242,242,242);border-top:#e6e6e6 1px solid">
    <div>
    <input class="layui-hide" readonly id="piCode"/>
    	<table class="layui-table">
    		<thead>
    			<tr>
    				<th colspan="4"><h2 style="text-align: center;">产品报检单信息</h2></th>
    			</tr>
    		</thead>
    		<tbody>
    			<tr>
    				<td width="20%">报检单号</td>
    				<td><input class="layui-input" readonly id="piNumber"/></td>
    				<td width="20%">台车编号</td>
    				<td><input class="layui-input" readonly id="trolleyNumber"/></td>
    			</tr>
    			<tr>
    				<td width="20%">产品名称</td>
    				<td><input class="layui-input" readonly id="piName"/></td>
    				<td width="20%">产品规格</td>
    				<td><input class="layui-input" readonly id="piStandard"/></td>
    			</tr>
    			<tr>
    				<td width="20%">产品编号</td>
    				<td><input class="layui-input" readonly id="pNumber"/></td>
    				<td width="20%">排产单号</td>
    				<td><input class="layui-input" readonly id="remark02"/><input class="layui-hide" id="remark04" name="remark04"/></td>
    			</tr>
    			<tr>
    				<td width="20%">计量单位</td>
    				<td><input class="layui-input" readonly id="piUnit"/></td>
    				<td width="20%">报检数量</td>
    				<td><input class="layui-input" readonly id="piNum"/></td>
    			</tr>
    			<tr>
    				<td width="20%">报检人</td>
    				<td><input class="layui-input" readonly id="piPerson"/></td>
    				<td width="20%">报检日期</td>
    				<td><input class="layui-input" readonly id="piDate"/></td>
    			</tr>
    		</tbody>
    	</table>
    	<table class="layui-table">
    		<thead>
    			<tr>
    				<th colspan="4"><h2 style="text-align: center;">数点</h2></th>
    			</tr>
    		</thead>
    		<tbody id="tdetails">
    			<tr>
    				<td width="20%">产品条码 </td>
    				<td colspan="3"><input class="layui-input" id="nCode" placeholder="扫描录入"/></td>
    			</tr>
    			<tr>
    				<td width="20%">软胶堵孔数：    A: </td>
    				<td><input class="layui-input"  onFocus="this.value=''" oninput="rjOninputA()"  value = "0" type="number" id="rjNumA"/></td>
    				<td width="20%">软胶堵孔数：    B: </td>
    				<td><input class="layui-input" onFocus="this.value=''" oninput="rjOninputB()"  value= "0" type="number" id="rjNumB"/></td>
    			</tr>
    			<tr>
    				<td width="20%">硬胶堵孔数：    A: </td>
    				<td><input class="layui-input" onFocus="this.value=''" oninput="yjOninputA()"  value= "0" type="number" id="yjNumA"/></td>
    				<td width="20%">硬胶堵孔数：    B: </td>
    				<td><input class="layui-input" onFocus="this.value=''" oninput="yjOninputB()"  value= "0" type="number" id="yjNumB"/></td>
    			</tr>
    			<tr>
    				<td width="20%">总堵孔数：    A: </td>
    				<td><input class="layui-input" readonly value='0' id="ryjNumCountA"/></td>
    				<td width="20%">总堵孔数：    B: </td>
    				<td><input class="layui-input" readonly value='0' id="ryjNumCountB"/></td>
    			</tr>
    			<tr>
    				<td width="20%">MAX(软硬A总数，软硬B总数)【合格】 标准</td>
    				<td><input class="layui-input" readonly value='${zcLeakHuntingCriterionEntity.ryCountOne }'/></td>
    				<td width="20%">MAX(软硬A总数，软硬B总数)【异常】 标准</td>
    				<td><input class="layui-input" readonly value='${zcLeakHuntingCriterionEntity.ryCountTwo }'/></td>
    			</tr>
    			<tr>
    				<td width="20%">瘪丝数：A： </td>
    				<td><input class="layui-input" onFocus="this.value=''"  value= "0" type="number" id="bsNumA"/></td>
    				<td width="20%">瘪丝数：B： </td>
    				<td><input class="layui-input" onFocus="this.value=''"  value= "0" type="number" id="bsNumB"/></td>
    			</tr>
    			<tr>
    				<td width="20%">MAX(瘪丝A，瘪丝B)【合格】 标准</td>
    				<td><input class="layui-input" readonly value='${zcLeakHuntingCriterionEntity.bsCountOne }'/></td>
    				<td width="20%">MAX(瘪丝A，瘪丝B)【异常】 标准</td>
    				<td><input class="layui-input" readonly value='${zcLeakHuntingCriterionEntity.bsCountTwo }'/></td>
    			</tr>
    			<tr>
    				<td width="20%">弯曲、压丝数：A： </td>
    				<td><input class="layui-input" onFocus="this.value=''"  value= "0" type="number" id="wqysNumA"/></td>
    				<td width="20%">弯曲、压丝数：B： </td>
    				<td><input class="layui-input" onFocus="this.value=''"  value= "0" type="number" id="wqysNumB"/></td>
    			</tr>
    			<tr>
    				<td width="20%">MAX(弯丝A，弯丝B)【合格】 标准</td>
    				<td><input class="layui-input" readonly value='${zcLeakHuntingCriterionEntity.wsCountOne }'/></td>
    				<td width="20%">MAX(弯丝A，弯丝B)【异常】 标准</td>
    				<td><input class="layui-input" readonly value='${zcLeakHuntingCriterionEntity.wsCountTwo }'/></td>
    			</tr>
    			<tr>
    				<td width="20%">端面是否正常 </td>
    				<td>
						<select class="layui-select" id="isNormal">
			   				<option value="是">是</option>
			   				<option value="否">否</option>
		   				</select>
					</td>
    				<td width="20%">异常位置 </td>
    				<td>
						<select class="layui-select" id="place">
			   				<option value="无">无</option>
			   				<option value="外边缘">外边缘</option>
			   				<option value="端面">端面</option>
			   				<option value="中心管边缘">中心管边缘</option>
			   				<option value="扇区边缘">扇区边缘</option>
		   				</select>
					</td>
    			</tr>
    			<tr>
    				<td width="20%">非正常描述 </td>
    				<td colspan="3">
						<textarea class="layui-textarea" id="describe"></textarea>
					</td>
    			</tr>
    		</tbody>
    	</table>
    	<input class="layui-hide" id="remark01" name="remark01" defaultValue="上传正面图片路径" value=""/>
    	<input class="layui-hide" id="remark06" name="remark06" defaultValue="上传反面图片路径" value=""/>
    	<table class="layui-table">
    			<tr>
					<td style="width: 200px; height:150px"><video id="video" autoplay="autoplay" style="width:100%; height:100%; object-fit: fill;border: 1px solid red;"></video></td>
					<td style="width: 200px; height:150px"><canvas id="canvas" style="border: 1px solid red;width:100%; height:100%;"></canvas></td>
					<td align="left">
						<button class="layui-btn layui-btn-blue" onclick="getMedia()">开启摄像头</button>
						<button class="layui-btn layui-btn-blue" onclick="takePhoto()">拍照</button>
						<button type="button" class="layui-btn" id="filePos" name="file"><i class="layui-icon">&#xe67c;</i>上传正面图片</button>
						<button type="button" class="layui-btn" id="fileNeg" name="file"><i class="layui-icon">&#xe67c;</i>上传反面图片</button>
					</td>
				</tr>
    	</table>
    	<input style="color:red" class="layui-input" value="* 注：检测值小于等于【合格】则组件合格，大于等于【异常】则组件异常"/>
    	<input id="testTime" hidden/>
    	<div class="layui-form-item">
	   		<div class="" style="margin:10px 0 0 10px">
		  		<input class="layui-btn layui-btn-blue" type="button" style="padding: 0 30px" id="saveBtn" onclick = "save()" value="提交">
		  		<!-- <input class="layui-btn layui-btn-blue" type="button" style="padding: 0 30px" onclick = "unbundle()" value="台车解绑"> -->
			</div>
		</div>
    </div>
</div>
<script src="${pageContext.request.contextPath }/assets/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/layui.all.js"></script>
<script src="${pageContext.request.contextPath }/assets/js/jquery.min.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/js/toastr.min.js" charset="utf-8"></script>
<script type="text/javascript">
		//数据输入改变事件
		function rjOninputA(){
			var rjNumA = Number($("#rjNumA").val());
			var yjNumA = Number($("#yjNumA").val());
			$("#ryjNumCountA").val(rjNumA+yjNumA);
		}
		function yjOninputA(){
			var rjNumA = Number($("#rjNumA").val());
			var yjNumA = Number($("#yjNumA").val());
			$("#ryjNumCountA").val(rjNumA+yjNumA);
		}
		function rjOninputB(){
			var rjNumB = Number($("#rjNumB").val());
			var yjNumB = Number($("#yjNumB").val());
			$("#ryjNumCountB").val(rjNumB+yjNumB);
		}
		function yjOninputB(){
			var rjNumB = Number($("#rjNumB").val());
			var yjNumB = Number($("#yjNumB").val());
			$("#ryjNumCountB").val(rjNumB+yjNumB);
		}
		//判定一个字符串是否在另一个字符串中
		function in_array(stringToSearch, arrayToSearch) {
		     for (s = 0; s < arrayToSearch.length; s++) {
		      	thisEntry = arrayToSearch[s].toString().toUpperCase();
		      	if (thisEntry == stringToSearch) {
		       		return true;
		      	}
		     }
     		return false;
		}
		//进入检漏
		function goLeakHunting(){
			 window.location.href="${pageContext.request.contextPath }/leakHunting/enterLeakHuntingPage.do";
		}
		//trim封装　 
		function trim(str) {
		    return str.replace(/^\s+|\s+$/g, "");
		}
		//日期格式转换
		function date2String(timestamp){
			var d = new Date(timestamp);
			var date = (d.getFullYear()) + "-" + 
	           (d.getMonth() + 1<10?"0"+(d.getMonth() + 1):d.getMonth() + 1) + "-" +
	           (d.getDate()<10?"0"+d.getDate():d.getDate()) + " " + 
	           (d.getHours()<10?"0"+d.getHours():d.getHours()) + ":" + 
	           (d.getMinutes()<10?"0"+d.getMinutes():d.getMinutes()) + ":" + 
	           (d.getSeconds()<10?"0"+d.getSeconds():d.getSeconds());
	           
	           return date;
		}
		$("#keyword").click(function(){
			layer.open({
	            type: 1 					//Page层类型
	            ,area: ['1000px', '450px']   //宽  高
	            ,title: '待检列表'
	            ,shade: 0.6 				//遮罩透明度
	            ,maxmin: true			    //允许全屏最小化
	            ,anim: 1 					//0-6的动画形式，-1不开启
	            /* ,content: $("#lookupTable2") */
	            ,content: '<table class="layui-hide" id="lookupTable2" lay-filter="lookupTable2"></table>'
	            ,success:function(){
	                layui.use(['table'], function(){
	                    var table = layui.table;
	                    table.render({
	                        elem: '#lookupTable2'
	                        ,url:'${pageContext.request.contextPath }/numbered/selectProductInspectionList.do'
	                        ,title: '产品待检列表'
	                        ,cols: [[
	                            {field:'', title:'序号', sort: true, type:'numbers', width: 60}
	                            ,{field:'piNumber', title:'报检单号'}
	                            ,{field:'trolleyNumber', title:'台车编号'}
	                            ,{field:'piName', title:'产品名称'}
	                            ,{field:'piStandard', title:'产品规格'}
	                            ,{field:'piUnit', title:'计量单位'}
	                            ,{field:'piNum', title:'报检数量'}
	                            ,{field:'piPerson', title:'报检人'}
	                            ,{field:'piDate', title:'报检时间',width:150,templet :function (row){
	                                	return date2String(row.piDate.time);
	                            	}   
	                            }
	                        ]]
	                        ,page: false
	                    });
		                table.on('rowDouble(lookupTable2)', function(obj){
		                    var number = obj.data.piNumber;
		                    var piCode = obj.data.piCode;
		                    $("#keyword").val(number);
		                    $("#piCode").val(piCode);
		                    layer.closeAll();
		                 });
	                });
	            }
			})
		})
		function search(){
			var keyword = $("#keyword").val();
			$.ajax({
				url:'${pageContext.request.contextPath }/numbered/selectProductInspection.do'
				,type:'post'
				,data:{"keyword":keyword}
				,dataType:'json'
				,success:function(res){
					if(res==0){
						toastr.warning("没有匹配项！");
						$("#details").css("display","none");
					}else{
						$("#details").css("display","block");
						$("#piNumber").val(res.piNumber);
						$("#trolleyNumber").val(res.trolleyNumber);
						$("#piName").val(res.piName);
						$("#piStandard").val(res.piStandard);
						$("#piUnit").val(res.piUnit);
						$("#piNum").val(res.piNum);
						$("#piPerson").val(res.piPerson);
						$("#piDate").val(date2String(res.piDate.time));
						$("#pNumber").val(res.remark01);
						$("#pNumber").val(res.remark01);
						$("#remark02").val(res.remark02);
						$("#remark04").val(res.remark03);
						var piNumber = res.piNumber;
						//判断数点数量
						$.ajax({
							type:'post'
							,url:'${pageContext.request.contextPath }/numbered/countProductTestByPiNumber.do'
							,data:{piNumber:piNumber}
							,dataType:'json'
							,success:function(data){
								var piNum =  $("#piNum").val();
								if(data == piNum){
									unbundle(piNumber);
								}
							}
						})
						
					}
				}
			})
		}
		function keyDown(e){
		    //IE内核浏览器  
		     if (navigator.appName == 'Microsoft Internet Explorer'){  
		           var keycode = event.keyCode;  
		           var realkey = String.fromCharCode(event.keyCode);  
		     }else {//非IE内核浏览器  
		           var keycode = e.which;  
		           var realkey = String.fromCharCode(e.which);  
		     }  

		   //监听Enter键  
		   if(keycode==13){
			   	var nCode = $("#nCode").val();
			   	var piCode = $("#piCode").val();
			   	var piCodeList = piCode.split(",");
			   	if(nCode.length != 16 || nCode[1].toUpperCase() != 'P' || nCode[2].toUpperCase() != 'S'){
			   		toastr.warning("请扫描正确的组件条码！");
			   		$("#nCode").val("");
			   	}else{
			   		var isInArray = in_array(nCode.toUpperCase(),piCodeList);
			   		if(!isInArray){
			   			toastr.warning("这个组件未报检！");
				   		$("#nCode").val("");
			   		}else{
			   			var d = new Date();
					    var date = (d.getFullYear()) + "-" + 
				           (d.getMonth() + 1<10?"0"+(d.getMonth() + 1):d.getMonth() + 1) + "-" +
				           (d.getDate()<10?"0"+d.getDate():d.getDate()) + " " + 
				           (d.getHours()<10?"0"+d.getHours():d.getHours()) + ":" + 
				           (d.getMinutes()<10?"0"+d.getMinutes():d.getMinutes()) + ":" + 
				           (d.getSeconds()<10?"0"+d.getSeconds():d.getSeconds());
				           $("#testTime").val(date);
				           //查看是否已经数点
				           var ptCode = $("#nCode").val();
				           $("#saveBtn").attr("disabled", false);
							$("#saveBtn").css('background-color','#009688');
				           $.ajax({
				        	   type:'post'
				   				,url:'${pageContext.request.contextPath }/numbered/countNumberByCode.do'
				   				,data:{ptCode:ptCode}
				   				,success:function(res){
				   					 if(res!=0){
				   						toastr.warning("未返工或已经完成数点！");
				   						$("#saveBtn").attr("disabled", true);
				   						$("#saveBtn").css('background-color','#DDD');
				   					 }
				   				}
				           })
			   		}
			   	}
		   }  
		   
		}  
		//按键事件
		document.onkeydown=keyDown;
		//保存处置结果
		function save(){
			$("#saveBtn").attr("disabled",true);
			var ptCode = $("#nCode").val();
			if(ptCode==""){
				toastr.warning("请先扫描条形码！");
				/* setTimeout(function(){  //使用  setTimeout（）方法设定定时500毫秒
					window.location.reload();  
				},1000); */
			}else{
				var piNumber = $("#piNumber").val();
				var piPerson = $("#piPerson").val();
				var piDate = $("#piDate").val();
				var number = "ZJ"+(new Date()).getTime();
				var ptName = $("#piName").val();
				var ptStandard = $("#piStandard").val();
				var ptStatus = "0";
				var remark01 = $("#pNumber").val();
				var remark02 = $("#remark02").val();
				var remark04 = $("#remark04").val();
				$.ajax({
					type:'post'
					,url:'${pageContext.request.contextPath }/numbered/insertProductTest.do'
					,data:{piNumber:piNumber,piPerson:piPerson,piDate:piDate,number:number,ptName:ptName,ptCode:ptCode,ptStandard:ptStandard,ptStatus:ptStatus,remark01:remark01,remark02:remark02,remark04:remark04}
					,success:function(res){
						if(res>0){
							var nCode = $("#nCode").val();
							var rjNumA = parseInt($("#rjNumA").val()==''?0:$("#rjNumA").val());
							var rjNumB = parseInt($("#rjNumB").val()==''?0:$("#rjNumB").val());
							var yjNumA = parseInt($("#yjNumA").val()==''?0:$("#yjNumA").val());
							var yjNumB = parseInt($("#yjNumB").val()==''?0:$("#yjNumB").val());
							var ryjNumCountA = parseInt($("#ryjNumCountA").val()==''?0:$("#ryjNumCountA").val());
							var ryjNumCountB = parseInt($("#ryjNumCountB").val()==''?0:$("#ryjNumCountB").val());
							var bsNumA = parseInt($("#bsNumA").val()==''?0:$("#bsNumA").val());
							var bsNumB = parseInt($("#bsNumB").val()==''?0:$("#bsNumB").val());
							var wqysNumA = parseInt($("#wqysNumA").val()==''?0:$("#wqysNumA").val());
							var wqysNumB = parseInt($("#wqysNumB").val()==''?0:$("#wqysNumB").val());
							var isNormal = $("#isNormal").val();
							var place = $("#place").val();
							var describe = $("#describe").val();
							var testTime = $("#testTime").val();
							var remark01x = $("#remark01").val();
							var remark06 = $("#remark06").val();
							$.ajax({
								type:'post'
								,url:'${pageContext.request.contextPath }/numbered/insertNumbered.do'
								,data:{number:number,nCode:nCode,rjNumA:rjNumA,rjNumB:rjNumB,yjNumA:yjNumA,yjNumB:yjNumB,ryjNumCountA:ryjNumCountA,ryjNumCountB:ryjNumCountB,bsNumA:bsNumA,bsNumB:bsNumB,wqysNumA:wqysNumA,wqysNumB:wqysNumB,isNormal:isNormal,place:place,describe:describe,testTime:testTime,remark01:remark01x,remark06:remark06}
								,dataType:'json'
								,success:function(data){
									if(data>0){
										toastr.success("提交成功！");
										setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
											search();
											$("#nCode").val("");
											$("#rjNumA").val("0");
											$("#rjNumB").val("0");
											$("#yjNumA").val("0");
											$("#yjNumB").val("0");
											$("#ryjNumCountA").val("0");
											$("#ryjNumCountB").val("0");
											$("#bsNumA").val("0");
											$("#bsNumB").val("0");
											$("#wqysNumA").val("0");
											$("#wqysNumB").val("0");
											$("#tdetails textarea").val("");
										},2000);
									}else{
										toastr.error("提交失败！");
									}
								}
							})
						}else{
							/* toastr.error("保存失败！"); */
						}
					}
				})
			}
		}
		//台车解绑
		function unbundle(piNumber){
			layer.confirm('台车数点完成，确定解绑吗？', function(index){
			    $.ajax({
		        	   type:'post'
		   				,url:'${pageContext.request.contextPath }/numbered/unbundle.do'
		   				,data:{piNumber:piNumber}
		   				,success:function(res){
		   					 if(res>0){
		   						toastr.success("解绑成功！");
		   						setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
									window.location.reload();
								},2000);
		   					 }else{
		   						toastr.error("解绑失败！");
		   					 }
		   				}
		           })
			    layer.close(index);
			  });
		}
		//开启摄像头
		function getMedia() {
	        let constraints = {
	            video: {width: 200, height: 150},
	            audio: true
	        };
	        let promise = navigator.mediaDevices.getUserMedia(constraints);
	        promise.then(function (MediaStream) {
	            video.srcObject = MediaStream;
	            video.play();
	        });
		}
		
		//拍照上传
		function takePhoto() {
	     	//获得Canvas对象
	     	let video = document.getElementById("video");
	     	let canvas = document.getElementById("canvas");
	     	let ctx = canvas.getContext('2d');
	     	//在画布坐标（0,0）的位置绘制一张宽度为300，高度为200的图片
	     	ctx.drawImage(video, 0, 0, 300, 150);
	     	var timestamp = Date.parse(new Date());
	     	downloadCanvasIamge('canvas', timestamp);
		}
		
		// 下载Canvas元素获取的图片
		function downloadCanvasIamge(selector, name) {
		    // 通过选择器获取canvas元素
		    var canvas = document.querySelector(selector);
		    var url = canvas.toDataURL('image/png');
		    var a = document.createElement('a');
		    var event = new MouseEvent('click');
		    a.download = name || Date.parse(new Date());
		    a.href = url;
		    // 触发a的单击事件
		    a.dispatchEvent(event);
		}
		layui.use(['table','layer','upload','form','laydate'], function(){
			var table = layui.table;
			var layer = layui.layer;
			var laydate = layui.laydate;
		    var form = layui.form;
		    var upload = layui.upload;
			//正面多文件上传
	        upload.render({
	          elem: '#filePos'
	          ,url: '${pageContext.request.contextPath}/upload/picUpload.do'
	          ,multiple: true
	          //允许上传的文件类型
	          ,exts: 'jpg|png|gif|jpeg|PNG|zip|rar|txt|doc|docx|xls|xlsx|ppt|pptx|mp3|mp4|avi|flv|rm|rmvb|'
	          /* ,before: function(obj){
	            //预读本地文件示例，不支持ie8
				obj.preview(function(index, file, result){
	              	$('#demo2').append('<img src="'+ result +'" alt="'+ file.name +'" class="layui-upload-img">')
	            });
	          } */
	          ,done: function(res){
	            //上传完毕
	       	  if(res != "" && res != null){
		      		toastr.success('文件上传成功！');
		      		//$("#viewFiles").attr('href','http://localhost:8000//attachment//samplekeep'+res);
			      	$("#remark01").val(res);
		      	}else{
		      		toastr.warning('图片上传失败！');
		      	}
	          }
	        });
			//反面多文件上传
	        upload.render({
	          elem: '#fileNeg'
	          ,url: '${pageContext.request.contextPath}/upload/picUpload.do'
	          ,multiple: true
	          //允许上传的文件类型
	          ,exts: 'jpg|png|gif|jpeg|PNG|zip|rar|txt|doc|docx|xls|xlsx|ppt|pptx|mp3|mp4|avi|flv|rm|rmvb|'
	          /* ,before: function(obj){
	            //预读本地文件示例，不支持ie8
				obj.preview(function(index, file, result){
	              	$('#demo2').append('<img src="'+ result +'" alt="'+ file.name +'" class="layui-upload-img">')
	            });
	          } */
	          ,done: function(res){
	            //上传完毕
	       	  if(res != "" && res != null){
		      		toastr.success('文件上传成功！');
		      		//$("#viewFiles").attr('href','http://localhost:8000//attachment//samplekeep'+res);
			      	$("#remark06").val(res);
		      	}else{
		      		toastr.warning('图片上传失败！');
		      	}
	          }
	        });
		})
		toastr.options.positionClass = 'toast-top-center'; //提示框的位置设置为中上
	</script>
</body>
</html>